package top.sinfonia.sample.designpattern.behavioral.command;

/**
 * <br>
 * <b>Project:</b> design-pattern-sample<br>
 * <b>Date:</b> 2017/11/7 10:10<br>
 * <b>Author:</b> Asher<br>
 *
 * 命令接口实现对象，是“虚”的实现，通常会持有接收者，并调用接收者功能来完成真正要执行的操作
 */
public class ConcreteCommand implements Command {
    private final Receiver receiver;

    public ConcreteCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        receiver.action();
    }
}
